Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micro-ftch

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-ftch

Wraps nodejs built-in modules and browser fetch into one function.

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
445K
decreased by-8.89%
Maintainers
1
Weekly downloads
 
Created
Source

micro-ftch

Wraps nodejs built-in modules and browser fetch into one function

Usage

Can be used in browser and in node.js.

npm install micro-ftch

const fetch = require('micro-ftch');
fetch('https://google.com').then(...)

Options

The list of options that can be supplied as second argument to fetch(url, opts):

export type FETCH_OPT = {
  method?: string;
  type?: 'text' | 'json' | 'bytes'; // Response encoding (auto-detect if empty)
  redirect: boolean; // Follow redirects
  expectStatusCode?: number | false; // Expect this status code
  headers: Record<string, string>;
  data?: object; // POST/PUT/DELETE request data
  full: boolean; // Return full request {headers, status, body}
  keepAlive: boolean; // Enable keep-alive (node only)
  cors: boolean; // Allow CORS safe-listed headers (browser-only)
  referrer: boolean; // Send referrer (browser-only)
  sslAllowSelfSigned: boolean; // Allow self-signed ssl certs (node only)
  sslPinnedCertificates?: string[]; // Verify fingerprint of certificate (node only)
  _redirectCount: number;
};

License

MIT License (c) 2020, Paul Miller (https://paulmillr.com)

Keywords

FAQs

Package last updated on 08 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc